package com.zmc.lostfound.system.vo;

import com.zmc.lostfound.common.valid.AddGroup;
import com.zmc.lostfound.common.valid.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * @author ZMC
 * @description 通知公告新增/修改请求体
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("通知公告新增/修改请求体")
public class NoticeSaveVO implements Serializable {

    private static final long serialVersionUID = 3039645087914143139L;

    /**
     * 公告id
     */
    @ApiModelProperty("公告id")
    @Null(message = "新增公告信息: 公告id必须为空", groups = {AddGroup.class})
    @NotNull(message = "修改公告信息: 公告id不能为空", groups = {UpdateGroup.class})
    @Min(value = 1, message = "修改公告信息: 公告id必须大于等于1", groups = {UpdateGroup.class})
    private Long id;

    /**
     * 发布用户id
     */
    @ApiModelProperty("发布用户id")
    @NotNull(message = "新增公告信息: 发布用户id不能为空", groups = {UpdateGroup.class})
    private Long userId;

    /**
     * 公告标题
     */
    @ApiModelProperty("公告标题")
    @NotBlank(message = "新增公告信息: 公告标题不能为空", groups = {AddGroup.class})
    private String title;

    /**
     * 公告内容
     */
    @ApiModelProperty("公告内容")
    @NotBlank(message = "新增公告信息: 公告内容不能为空", groups = {AddGroup.class})
    private String content;

}
